package com.example.hbutliving;

import com.google.gson.Gson;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.client.RestTemplate;

/**
 * @author lizijian
 */
//开启异步
@EnableAsync
//@EnableDiscoveryClient
@SpringBootApplication
public class HbutLivingApplication {

  public static void main(String[] args) {
    ConfigurableApplicationContext context = SpringApplication.run(HbutLivingApplication.class, args);
  }

  @Bean
  public RestTemplate restTemplate(){
    return new RestTemplate();
  }

  @Bean
  public Gson gson(){
    return new Gson();
  }

  @Bean("reduceHot")
  public ScheduledExecutorService singleThreadPoolExecutorService(){
    return Executors.newSingleThreadScheduledExecutor();
  }



}
